package cn.amoqi.springbootasync.controller;

import cn.amoqi.springbootasync.IndexService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @author: zhuiFeng
 * @date: 2021年06月03日 14:31
 */
@RestController
@Slf4j
public class IndexController {

    @Autowired
    private IndexService indexService;

    @RequestMapping
    public String index(){
        log.info("我在执行一个耗时操作！");
        indexService.async();
        log.info("主线程结束！");
        return "spring-boot-async";
    }


}
